import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [{
    path: "/admin/login",
    name: "admin_login",
    component: () => import("../views/admin/login"),
  },
  {
    path: "/admin/home",
    name: "admin_home",
    component: () => import("../views/admin/home"),
    redirect: "/admin/index",
    children: [{
        path: "/admin/index",
        name: "admin_index",
        component: () => import("@/views/admin/home/index"),
        meta: {
          bread: ['管理后台', '后台首页']
        }
      },
      {
        path: "/admin/user",
        name: "admin_user",
        component: () => import("../views/admin/user/list"),
        meta: {
          bread: ['用户管理', '用户列表']
        }
      },
      {
        path: "/admin/goods",
        name: "admin_goods",
        component: () => import("../views/admin/goods/list"),
        meta: {
          bread: ['商品管理', '商品列表'],
          title: '基础表格'
        }
      },
      {
        path: "/admin/goods/wares",
        name: "admin_goods_wares",
        component: () => import("../views/admin/goods/wares"),
        meta: {
          bread: ['商品管理', '商品列表1']
        }
      },
      {
        path: "/admin/goods/create",
        name: "admin_goods_create",
        component: () => import("../views/admin/goods/create"),
        meta: {
          bread: ['商品管理', '商品添加']
        }
      },
      {
        path: "/admin/goods/tab",
        name: "admin_goods_tab",
        component: () => import("../views/admin/goods/tab"),
        meta: {
          bread: ['商品管理', '商品添加'],
          title: "tab选项卡"
        }
      },
      {
        path: "/admin/authority",
        name: "admin_authority",
        component: () => import("../views/admin/authority/power"),
        meta: {
          bread: ['权限管理', '权限列表']
        }
      },
      {
        path: "/admin/authority/role",
        name: "admin_authority_role",
        component: () => import("../views/admin/authority/role"),
        meta: {
          bread: ['权限管理', '角色列表']
        }
      },
      {
        path: "/admin/statistics",
        name: "admin_statistics",
        component: () => import("../views/admin/statisticst/statistics"),
        meta: {
          bread: ['数据统计', '数据列表']
        }
      },
      {
        path: "/admin/olders/older",
        name: "admin_olders_older",
        component: () => import("../views/admin/olders/older"),
        meta: {
          bread: ['订单管理', '订单列表']
        }
      },
    ],
  },
  {
    path: "/",
    redirect: "/admin/login"
  },
];

const router = new VueRouter({
  routes
});

export default router;